<?php
/**
  * tframe
  *
  * 用于处理header 
  * @copyright Copyright (c) 2012 - 2014, huxiaomin
  * @author huxiaomin    2012-7-8  
  * @since		Version 1.0
  *
  */


class THeader{
      static $HEADERS = array(
                    );
      
      
      static function location($url){
         self::$HEADERS['location'] = $url;
      }
      
      static function contentType($contentType='text/html',$encode='utf-8'){
         if ($contentType == 'text/html'){
            self::$HEADERS['contentType'] = "Content-Type: {$contentType}; charset={$encode}";
         }
         else {
            self::$HEADERS['contentType'] = "Content-Type: {$contentType};";
         }
      }
      
      static function header($header){
      	$tmp = explode(',', $header);
        self::$HEADERS[$tmp[0]] = $header;
      }
    
}